const sequelize = require('../db.js')
const { QueryTypes } = require('sequelize');
const router = require('koa-router')()
router.prefix('/category')

router.get('/',async ctx=>{
    let {pid} = ctx.query
    // console.log(ctx.params)
    ctx.body = {
        code:200,
        data:await sequelize.query(`select * from category where pid =${pid}`,{ type: QueryTypes.SELECT })
    }
})
module.exports = router